import request from '../utils/request'

// 查询用户列表
export function listUs(query) {
  return request({
    url: '/system/us/list',
    method: 'get',
    params: query
  })
}

// 查询用户详细
export function getUs(id) {
  return request({
    url: '/system/us/' + id,
    method: 'get'
  })
}

// 新增用户
export function addUs(data) {
  return request({
    url: '/system/us',
    method: 'post',
    data: data
  })
}

// 修改用户
export function updateUs(data) {
  return request({
    url: '/system/us',
    method: 'put',
    data: data
  })
}

// 删除用户
export function delUs(id) {
  return request({
    url: '/system/us/' + id,
    method: 'delete'
  })
}

export function upfile(data) {
  return request({
    url: '/system/us/import',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    timeout: 0 // 设置超时时间为 0 表示不限制请求时间
  })
}

// 导出用户
export function expUsr() {
  return request({
    url: '/system/us/word',
    method: 'post'
  
  })
}


export function srcimg(filename) {
  return request({
    url: '/system/us/local-image/' + filename,
    method: 'get'
  })
}

export function exportWord(param) {
  return request({
    url: '/system/us/word',
    method: 'POST',
    data: param,
    responseType: 'blob'
  });
}
export function exportpdf(param) {
  return request({
    url: '/system/us/pdf',
    method: 'POST',
    data: param,
    responseType: 'blob'
  });
}
export function exportexcel(param) {
  return request({
    url: '/system/us/export',
    method: 'POST',
    data: param,
    responseType: 'blob'
  });
}